package com.example.fitnessservice.service.impl;

import com.example.fitnessservice.module.dao.usermapper.MyMapper;
import com.example.fitnessservice.module.pojo.UserInfo;
import com.example.fitnessservice.service.MyService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class MyServiceImpl implements MyService {

    @Resource
    private MyMapper myMapper;

    @Override
    public UserInfo findMyInfo(Integer userId) {
        return myMapper.findMyInfo(userId);
    }

    @Override
    public boolean addMyInfo(UserInfo userInfo) {
        int count = myMapper.addMyInfo(userInfo);
        return count == 1;
    }

    @Override
    public boolean updateMyInfo(UserInfo userInfo) {
        int count = myMapper.updateMyInfo(userInfo);
        return count == 1;
    }
}
